package com.zankong.tool.zkapp.views.hr;

import android.graphics.Color;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.zankong.tool.zkapp.R;
import com.zankong.tool.zkapp.document.ZKDocument;
import com.zankong.tool.zkapp.views.ZKViewAgent;

import org.dom4j.Attribute;
import org.dom4j.Element;

/**
 * Created by YF on 2018/7/24.
 */

public class Hr_1 extends ZKViewAgent {

    private TextView mLinearLayout;

    public Hr_1(ZKDocument zkDocument, Element element) {
        super(zkDocument, element);
    }

    @Override
    public void initView(ViewGroup viewGroup) {
        setContentView(R.layout.view_line_1);
        mLinearLayout = ((TextView) findViewById(R.id.line));
    }

    @Override
    public void fillData(Element selfElement) {
        for (Attribute attribute : selfElement.attributes()) {
            String value = attribute.getValue();
            switch (attribute.getName()) {
                case "color":
                    mLinearLayout.setBackgroundColor(Color.parseColor(value));
                    break;
            }
        }
    }

    @Override
    public Object getResult() {
        return null;
    }
}
